package liwq;

import java.util.Arrays;

/**
 * @author : liwq
 * @version : 1.0
 * @date : 2023/4/26
 **/
public class LiwqTest {

    public static void bubblesort(int a[]) {
        for (int j = a.length -1; j > 0; j--) {
            for (int i = 0; i < j; i++) {
                if(a[i] < a[i+1]){
                    change(a,i,i+1);


                }

            }
        }
    }


    public static void change(int a[], int i, int j) {
        int temp = a[i];
        a[i] = a[j];
        a[j] = temp;

    }


    public static void main(String[] args) {
        int a[] = {1, 3, 5, 95, 13, 45, 67, 13, 87, 12, 65};
        bubblesort(a);
        System.out.println(Arrays.toString(a));

    }


}
